<?php
namespace validate;

class Store extends \check\Check{
    //验证规则
    protected $rule = [
        'mobile' => 'require|mobile',
        'code' => 'require|length:6',
        'password' => 'require|max:32|min:6',
        'repassword' => 'require|confirm:password',
    ];
    //验证消息
    protected $message = [
        'mobile.require' => '手机号必须填写',
        'mobile.mobile' => '请检查手机号格式是否正确',
        'code.require' => '手机验证码不能为空',
        'code.length' => '手机验证码长度必须是6位',
        'password.require' => '密码必须填写',
        'password.min' => '密码必须在6-32位之间',
        'password.max' => '密码必须在6-32位之间',
        'repassword.require' => '确认密码不能为空',
        'repassword.confirm' => '两次密码输入不一致',
    ];
    //验证场景
    protected $scene = [
        'login_ps' => ['mobile', 'password'],
        'register' => ['mobile', 'code', 'password', 'repassword'],
        'login_code' => ['mobile', 'code'],
        'mobile' => ['mobile']
    ];
}